﻿/*
 * Created by SharpDevelop.
 * User: e800357
 * Date: 9/15/2012
 * Time: 4:40 PM
 * 
 * To change this template use Tools | Options | Coding | Edit Standard Headers.
 */
using System;

namespace FizzBuzz
{
	class Program
	{
		public static void Main(string[] args)
		{
			Console.Write("Press 1 for output to console, 2 for file (file will be created at C:/temp/) . . .");
			string input =  Console.ReadLine( );
			int i;
			if(int.TryParse(input, out i))
			{             
				Console.Write("Enter start of range:");
				int start =  Convert.ToInt32(Console.ReadLine( ));
				Console.Write("Enter end of range:");
				int finish =  Convert.ToInt32(Console.ReadLine( ));
				Console.Write("Enter token 1:");
				string token1 =  Console.ReadLine( );
				Console.Write("Enter token 2:");
				string token2 =  Console.ReadLine( );
				
				//create FizzBuzz object and call .Print method
				FizzBuzz fb = new FizzBuzz();
				fb.Start = start;
				fb.Finish = finish;
				fb.Token1 = token1;
				fb.Token2 = token2;
				
				switch (i)
				{
					case(1):
						fb.PrintToConsole();
						break;
					case(2):
						fb.PrintToFile("C:\\Temp\\FizzBuzz_" + DateTime.Now.ToFileTimeUtc() + ".txt");
						break;
					default:
						Console.WriteLine("\nOutput type not implemented yet.");
						break;
				}
			}         
			else
				Console.WriteLine("\nInvalid entry.");
			
			Console.Write("Press any key to end program . . . ");
			Console.ReadKey(true);
		}
	}
}